# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Fazlul Shahriar <fshahriar@gmail.com>
# Contributor: Denis Zawada <deno@bajtogrod.pl>

pkgname=igraph
pkgver=0.10.4
pkgrel=1
pkgdesc='A library for creating and manipulating (un)directed graphs'
arch=(loong64 x86_64)
url='https://igraph.org/c/'
license=(GPL2)
depends=(glpk arpack libxml2 plfit)
makedepends=(cmake)
source=(https://github.com/igraph/igraph/releases/download/$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('aa5700b58c5f1e1de1f4637ab14df15c6b20e25e51d0f5a260921818e8f02afc')

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=None \
    -DBUILD_SHARED_LIBS=ON
  cmake --build build
}

check() {
  cmake --build build --target check
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
